﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LIM.model;

namespace LIM.controller
{
    public class DanhMucPhongBanController : BaseController
    {
        public List<tbl_DanhMuc_PhongBan> LayDanhSach_PhongBan()
        {
            var results = LIMS_Entities.tbl_DanhMuc_PhongBan.ToList();
            return results;
        }

        public tbl_DanhMuc_PhongBan LayPhongBanByRowID(int RowID)
        {
            return LIMS_Entities.tbl_DanhMuc_PhongBan.Where(p => p.RowID == RowID).FirstOrDefault();
        }

        public tbl_DanhMuc_PhongBan LayPhongBanByMaPhongBan(string maPhongBan)
        {
            return LIMS_Entities.tbl_DanhMuc_PhongBan.Where(p => p.MaPhongBan.ToLower() == maPhongBan.ToLower()).FirstOrDefault();
        }
    }
}
